// 博客模块

const Router = require('koa-router')
const router = new Router()

const auth = require('../middleware/auth')
const { getBlog, addBlog, editBlog, delBlog } = require('../controller/blog')
// 获取博客列表  分页 模糊查询
router.get('/blog/list', getBlog)
// 添加博客
router.post('/blog/list', addBlog)
// 更新博客
router.put('/blog/list', editBlog)
// 删除博客
router.delete('/blog/list/:id', auth, delBlog)

module.exports = router;